home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
vol_200
/
261_01
/
asmt.c
< prev
next >
Wrap
Text File
|
1988-02-23
|
26KB
|
856 lines
/* asmt.c - mnemonic tables for as68, a 68000 assembler...
* (C) Copyright 1982 Steve Passe
* All Rights Reserved
*
* version 1.00 created 11/2/82
* version 1.01
*
* 8/30/83 ver. 1.01 modified for Aztec ver. 1.05g smp
*
*/
/* begincode */
#include "as68.h"
#define NULL 0
/* def of mtable size, 'MTSIZE'(205), is now in as68.h */
struct _mtable mtable[MTSIZE] = {
/* _mnem[8] _mvi _mvc _nops
*/
"!dummy", 0, 1, 0,
"abcd", 1, 2, 2,
"add", 18, 10, 2,
"add.b", 3, 5, 2,
"add.l", 8, 10, 2,
"add.w", 18, 10, 2,
"addq", 33, 3, 2,
"addq.b", 28, 2, 2,
"addq.l", 30, 3, 2,
"addq.w", 33, 3, 2,
"addx", 40, 2, 2,
"addx.b", 36, 2, 2,
"addx.l", 38, 2, 2,
"addx.w", 40, 2, 2,
"and", 53, 6, 2,
"and.b", 42, 6, 2,
"and.l", 48, 5, 2,
"and.w", 53, 6, 2,
"asl", 63, 3, 2,
"asl.b", 59, 2, 2,
"asl.l", 61, 2, 2,
"asl.w", 63, 3, 2,
"asr", 70, 3, 2,
"asr.b", 66, 2, 2,
"asr.l", 68, 2, 2,
"asr.w", 70, 3, 2,
"bcc", 73, 1, 1,
"bcc.s", 74, 1, 1,
"bchg", 75, 4, 2,
"bclr", 79, 4, 2,
"bcs", 83, 1, 1,
"bcs.s", 84, 1, 1,
"beq", 85, 1, 1,
"beq.s", 86, 1, 1,
"bge", 87, 1, 1,
"bge.s", 88, 1, 1,
"bgt", 89, 1, 1,
"bgt.s", 90, 1, 1,
"bhi", 91, 1, 1,
"bhi.s", 92, 1, 1,
"ble", 93, 1, 1,
"ble.s", 94, 1, 1,
"bls", 95, 1, 1,
"bls.s", 96, 1, 1,
"blt", 97, 1, 1,
"blt.s", 98, 1, 1,
"bmi", 99, 1, 1,
"bmi.s", 100, 1, 1,
"bne", 101, 1, 1,
"bne.s", 102, 1, 1,
"bpl", 103, 1, 1,
"bpl.s", 104, 1, 1,
"bra", 105, 1, 1,
"bra.s", 106, 1, 1,
"bset", 107, 4, 2,
"bsr", 111, 1, 1,
"bsr.s", 112, 1, 1,
"btst", 113, 4, 2,
"bvc", 117, 1, 1,
"bvc.s", 118, 1, 1,
"bvs", 119, 1, 1,
"bvs.s", 120, 1, 1,
"chk", 121, 3, 2,
"clr", 128, 2, 1,
"clr.b", 124, 2, 1,
"clr.l", 126, 2, 1,
"clr.w", 128, 2, 1,
"cmp", 143, 9, 2,
"cmp.b", 130, 4, 2,
"cmp.l", 134, 9, 2,
"cmp.w", 143, 9, 2,
"cmpm", 154, 1, 2,
"cmpm.b", 152, 1, 2,
"cmpm.l", 153, 1, 2,
"cmpm.w", 154, 1, 2,
"dbcc", 155, 1, 2,
"dbcs", 156, 1, 2,
"dbeq", 157, 1, 2,
"dbf", 158, 1, 2,
"dbge", 159, 1, 2,
"dbgt", 160, 1, 2,
"dbhi", 161, 1, 2,
"dble", 162, 1, 2,
"dbls", 163, 1, 2,
"dblt", 164, 1, 2,
"dbmi", 165, 1, 2,
"dbne", 166, 1, 2,
"dbpl", 167, 1, 2,
"dbra", 168, 1, 2,
"dbt", 169, 1, 2,
"dbvc", 170, 1, 2,
"dbvs", 171, 1, 2,
"divs", 172, 3, 2,
"divu", 175, 3, 2,
"eor", 187, 5, 2,
"eor.b", 178, 5, 2,
"eor.l", 183, 4, 2,
"eor.w", 187, 5, 2,
"exg", 192, 4, 2,
"ext", 197, 1, 1,
"ext.l", 196, 1, 1,
"ext.w", 197, 1, 1,
"jmp", 198, 1, 1,
"jsr", 199, 1, 1,
"lea", 200, 1, 2,
"link", 201, 1, 2,
"lsl", 206, 3, 2,
"lsl.b", 202, 2, 2,
"lsl.l", 204, 2, 2,
"lsl.w", 206, 3, 2,
"lsr", 213, 3, 2,
"lsr.b", 209, 2, 2,
"lsr.l", 211, 2, 2,
"lsr.w", 213, 3, 2,
"move", 236, 20, 2,
"move.b", 216, 6, 2,
"move.l", 222, 14, 2,
"move.w", 236, 20, 2,
"movem", 260, 4, 2,
"movem.l", 256, 4, 2,
"movem.w", 260, 4, 2,
"movep", 266, 2, 2,
"movep.l", 264, 2, 2,
"movep.w", 266, 2, 2,
"moveq", 268, 1, 2,
"muls", 269, 3, 2,
"mulu", 272, 3, 2,
"nbcd", 275, 2, 1,
"neg", 281, 2, 1,
"neg.b", 277, 2, 1,
"neg.l", 279, 2, 1,
"neg.w", 281, 2, 1,
"negx", 287, 2, 1,
"negx.b", 283, 2, 1,
"negx.l", 285, 2, 1,
"negx.w", 287, 2, 1,
"nop", 289, 1, 0,
"not", 294, 2, 1,
"not.b", 290, 2, 1,
"not.l", 292, 2, 1,
"not.w", 294, 2, 1,
"or", 307, 6, 2,
"or.b", 296, 6, 2,
"or.l", 302, 5, 2,
"or.w", 307, 6, 2,
"pea", 313, 1, 1,
"reset", 314, 1, 0,
"rol", 319, 3, 2,
"rol.b", 315, 2, 2,
"rol.l", 317, 2, 2,
"rol.w", 319, 3, 2,
"ror", 326, 3, 2,
"ror.b", 322, 2, 2,
"ror.l", 324, 2, 2,
"ror.w", 326, 3, 2,
"roxl", 333, 3, 2,
"roxl.b", 329, 2, 2,
"roxl.l", 331, 2, 2,
"roxl.w", 333, 3, 2,
"roxr", 340, 3, 2,
"roxr.b", 336, 2, 2,
"roxr.l", 338, 2, 2,
"roxr.w", 340, 3, 2,
"rte", 343, 1, 0,
"rtr", 344, 1, 0,
"rts", 345, 1, 0,
"sbcd", 346, 2, 2,
"scc", 348, 2, 1,
"scs", 350, 2, 1,
"seq", 352, 2, 1,
"sf", 354, 2, 1,
"sge", 356, 2, 1,
"sgt", 358, 2, 1,
"shi", 360, 2, 1,
"sle", 362, 2, 1,
"sls", 364, 2, 1,
"slt", 366, 2, 1,
"smi", 368, 2, 1,
"sne", 370, 2, 1,
"spl", 372, 2, 1,
"st", 374, 2, 1,
"stop", 376, 1, 1,
"sub", 392, 10, 2,
"sub.b", 377, 5, 2,
"sub.l", 382, 10, 2,
"sub.w", 392, 10, 2,
"subq", 407, 3, 2,
"subq.b", 402, 2, 2,
"subq.l", 404, 3, 2,
"subq.w", 407, 3, 2,
"subx", 414, 2, 2,
"subx.b", 410, 2, 2,
"subx.l", 412, 2, 2,
"subx.w", 414, 2, 2,
"svc", 416, 2, 1,
"svs", 418, 2, 1,
"swap", 420, 1, 1,
"tas", 421, 2, 1,
"trap", 423, 1, 1,
"trapv", 424, 1, 0,
"tst", 429, 2, 1,
"tst.b", 425, 2, 1,
"tst.l", 427, 2, 1,
"tst.w", 429, 2, 1,
"unlk", 431, 1, 1
};
int nn(), nnoy(), nnyy(), nx(), nnxx(), nd(), nd2(), ndob(), ndkk();
int ndoy(), ndyy(), ndyz(), ne(), nf(), nf2(), nfob(), nfoy(), nfyy(), nfyz();
int nhmm(), nj(), njmm(), nr(), nr2(), nrxx(), nryy(), nsmm(), nv(), cd(), cf();
int cd(), dnoy(), dnyy(), dnyz(), de(), dj(), dr(), dsxx(), dy();
int gnoy(), gnyy(), gnyz(), ge(), gs(), rd(), rf(), sdxx(), sf();
struct _mvalue mvalue[] = {
/* _optyp1 _optyp2 byte1 byte2 lngth code_fcn */
NULL, NULL, NULL, NULL, NULL, NULL,
/* ABCD */
_pd_ani, _pd_ani, 0xc1, 0x08, 1, dr,
_dn, _dn, 0xc1, 0x00, 1, dr,
/* ADD.B */
_imd, _dadr, 0x06, 0x00, 12, nfoy,
_imd, _dn, 0x06, 0x00, 2, ndoy,
_sadr, _dn, 0xd0, 0x00, 0, de,
_dn, _dadr, 0xd1, 0x00, 0, sf,
_dn, _dn, 0xd0, 0x00, 1, dr,
/* ADD.L */
_imd, _an, 0xd1, 0xfc, 3, dnyz,
_imd, _dadr, 0x06, 0x80, 13, nfyz,
_imd, _dn, 0x06, 0x80, 3, ndyz,
_an, _an, 0xd1, 0xc8, 1, dr,
_an, _dn, 0xd0, 0x88, 1, dr,
_dn, _an, 0xd1, 0xc0, 1, dr,
_dn, _dn, 0xd0, 0x80, 1, dr,
_dn, _dadr, 0xd1, 0x80, 0, sf,
_sadr, _an, 0xd1, 0xc0, 0, de,
_sadr, _dn, 0xd0, 0x80, 0, de,
/* ADD.W */
_imd, _an, 0xd0, 0xfc, 2, dnyy,
_imd, _dadr, 0x06, 0x40, 12, nfyy,
_imd, _dn, 0x06, 0x40, 2, ndyy,
_an, _an, 0xd0, 0xc8, 1, dr,
_an, _dn, 0xd0, 0x48, 1, dr,
_dn, _an, 0xd0, 0xc0, 1, dr,
_dn, _dn, 0xd0, 0x40, 1, dr,
_dn, _dadr, 0xd1, 0x40, 0, sf,
_sadr, _an, 0xd0, 0xc0, 0, de,
_sadr, _dn, 0xd0, 0x40, 0, de,
/* ADDQ.B */
_imd, _dadr, 0x50, 0x00, 0, cf,
_imd, _dn, 0x50, 0x00, 1, cd,
/* ADDQ.L */
_imd, _an, 0x50, 0x88, 1, cd,
_imd, _dadr, 0x50, 0x80, 0, cf,
_imd, _dn, 0x50, 0x80, 1, cd,
/* ADDQ.W */
_imd, _an, 0x50, 0x48, 1, cd,
_imd, _dadr, 0x50, 0x40, 0, cf,
_imd, _dn, 0x50, 0x40, 1, cd,
/* ADDX.B */
_pd_ani, _pd_ani, 0xd1, 0x08, 1, dr,
_dn, _dn, 0xd1, 0x00, 1, dr,
/* ADDX.L */
_pd_ani, _pd_ani, 0xd1, 0x88, 1, dr,
_dn, _dn, 0xd1, 0x80, 1, dr,
/* ADDX.W */
_pd_ani,